package expresionesManager;

import java.util.Hashtable;
import java.util.Vector;
import java.util.regex.Pattern;

import citasManager.Searcher;

public abstract class Expresion {
	protected Searcher buscador;
	protected Pattern parrafoExp = Pattern.compile("[\\.\\!\\?]\\s+", Pattern.MULTILINE);
	protected String expPalabraReferencia = "(Referencias)|(REFERENCIAS)|(REFERENCES)(\\.)*";
	
	public Expresion (){
		buscador = new Searcher();
	}
	
	
	public boolean isReferencesSection(String cad){
		String[] matches = buscador.search(expPalabraReferencia,cad);	
		return (matches.length!=0);
	}
	
	protected String[] getParrafos(String cadena){
		 String[] aux = parrafoExp.split(cadena);					
		return (aux);
	}
	
	public abstract Vector extraerCitas(String cadena);
	
	public abstract Vector extraerReferencias(String cadena);
	
	public abstract void actualizarBase(Vector foundCitas,Vector foundRefs);
}
